﻿@using Kevin.Shop.Business.Service.Entity.Helper

@model RiderShop.Mobile.Modle.Product.ProductListModel
<div class="product-list-body">

    <ul class="listsAll">

        @foreach (var item in Model.Result.Data)
        {
            <li class="list-items">
                <div class="product-item-wrapper">
                    <span><a href="~/Product/ProductDetail?prd=@item.ProductId"><img src="~/Themes/RongJi/Style/base/imgs/prolistdefault.jpg" data-src="@item.ActualImageUrl" alt="@item.Title" width="187" height="187" /></a></span>
                    <h3>
                        <a href="~/Product/ProductDetail?prd=@item.ProductId" title="@item.Title">@(item.Title.Length > 40 ? item.Title.Substring(0, 40) : item.Title)</a>
                        <div class="itemFeatures itemFeaturesWeb">
                            @Html.Raw(item.WebDescription)
                        </div>
                        <div class="itemFeatures itemFeaturesView">
                            @Html.Raw(item.ViewDescription)
                        </div>
                    </h3>
                    <div class="priceBag">
                        <p>￥@item.UnitPriceFormat <del>￥@item.MarketPrice</del></p>
                        @if (item.TotalInventory > 0)
                        {
                            if (item.Active)
                            {
                                <a href="/Product/AddToCart?prd=@item.ProductId" target="_blank" pid="@item.ProductId" onclick="productList.AddToCart(this);" class="addToMyBag" title="添加到购物车">添加到购物车</a>
                                <p class="tips"></p>
                            }
                            else
                            {
                                <div class="addToMyBag-no" title="此商品已下架">此商品已下架</div>
                            }
                        }
                        else
                        {
                            <div class="addToMyBag-no" title="此商品暂时缺货">此商品暂时缺货</div>
                        }
                    </div>
                </div>
            </li>
        }
        <br class="clearfix">
    </ul>

</div>
<footer class="product-list-footer">
    @Html.Partial(string.Format("~/Themes/{0}/Views/Shared/Pagination.cshtml", WebClientContext.Current.SiteTheme), Model)
</footer>



@if (Request.IsAjaxRequest())
{

    <script>
        $(".listPager .item").click(function () {
            var pageIndex = $(this).attr("pageindex");
            if (pageIndex) {
                $("#page").val(pageIndex);
                productList.RefreshList();

                RerenderProList();
                window.location.href = "#product-filters";
            }
        });
    </script>
}